#include <stdio.h>
#include <stdlib.h>

#include <myapi.h>

int main (int argc, char **argv)
{
    int ret = 0;
    int age = 0;
    intptr_t fd = 0;

    ret = myapi_init(&fd);
    if (ret != 0)
        printf("myapi_init failed:%d\n", ret);
    else
        printf("myapi_init success:\n");

    ret = myapi_set_age(&fd, 18);
    if (ret != 0)
        printf("myapi_set_age failed:%d\n", ret);
    else
        printf("myapi_set_age success:\n");

    ret = myapi_get_age(&fd, &age);
    if (ret != 0)
        printf("myapi_get_age failed:%d\n", ret);
    else
        printf("the age is:%d\n", age);

    ret = myapi_exit(&fd);
    if (ret != 0)
        printf("myapi_exit failed:%d\n", ret);
    else
        printf("myapi_exit success:\n");

    return 0;
} /* ----- End of main() ----- */

